---
title: Keywords
---

### TypeScript

<div>All\* built-in TypeScript keywords are directly available.</div>

<SyntaxTabs>
	<SyntaxTab string>
```ts
const Keywords = type({
	string: "string",
	date: "Date"
})
```
	</SyntaxTab>

    <SyntaxTab fluent>

```ts
const Keywords = type({
	string: type.string,
	date: type.Date
})
```

Common keywords are exposed directly on `type`.

    </SyntaxTab>

</SyntaxTabs>

<sup>
	\* `any` and `void` are misleading and unnecessary for runtime validation and
	so are not included as keywords by default.
</sup>

### Subtype

Subtype keywords refine or transform their root type.

<SyntaxTabs>
	<SyntaxTab string>
```ts
const Keywords = type({
	dateFormattedString: "string.date",
	transformStringToDate: "string.date.parse",
	isoFormattedString: "string.date.iso",
	transformIsoFormattedStringToDate: "string.date.iso.parse"
})
```

You can easily explore available subtypes via autocomplete by with a partial definition like `"string."`.

</SyntaxTab>

    <SyntaxTab fluent>

```ts
const Keywords = type({
	dateFormattedString: type.keywords.string.date.root,
	isoFormattedString: type.keywords.string.date.iso.root,
	transformStringToDate: type.keywords.string.date.parse,
	transformIsoFormattedStringToDate: type.keywords.string.date.iso.parse
})
```

All built-in keywords and modules are available in `type.keywords`.

`.root` gets the base type of a subtyped module so that it can be used as a `Type` directly.

    </SyntaxTab>

</SyntaxTabs>

### All Keywords

This table includes all keywords available in default `type` API. To define your own string-embeddable keywords, see [scopes](/docs/scopes).

<AllKeywordTables />
